package models

import (
	"rongyy/src/app"
)

type BankInfoModel struct {
	Id   int64  `xorm:"pk autoincr" json:"id"`
	Code string `json:"code"`
	Name string `json:"name"`
}

func (rm *BankInfoModel) Query() ([]BankInfoModel, int64, error) {
	cms := make([]BankInfoModel, 0)

	s := app.DB().Table("bank_info")
	total, err := s.Limit(999, 0).FindAndCount(&cms)
	if err != nil {
		return nil, 0, err
	}
	return cms, total, err
}
